<?php
namespace App\Http\Controllers\Client\Common;

use App\Http\Controllers\ClientController;
use App\Models\Common\Wechat;

class SubscribeCodeController extends ClientController
{

    /**
     * 生成带参数的二维码
     * @return \Illuminate\Http\JsonResponse
     */
    public function index()
    {
        $url = $this->all['url'];
        $app = Wechat::officialAccount();
        $result = $app->qrcode->temporary($url);
        $url = $app->qrcode->url($result['ticket']);
        return $this->setReturnJson(0,'success',['url'=>$url]);
    }

}
